<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String baseInfoJson= (String)request.getAttribute("baseInfoJson");
String medicalVentilatorInfoJson= (String)request.getAttribute("medicalVentilatorInfoJson");
String respondResultJson= (String)request.getAttribute("respondResultJson");
%>
<link rel="stylesheet" href="${basePath}assets/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="${basePath}assets/jquery-ui/jquery-ui.css"/>
<link rel="stylesheet" href="${basePath}assets/css/basic.css"/>
<link rel="stylesheet" href="${basePath}assets/css/coding/edit_index_info.css"/>
<script type="text/javascript" src="${basePath}assets/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}assets/jquery-ui/jquery-ui.js"></script>
<script type="text/javascript" src="${basePath}assets/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}assets/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${basePath}assets/jqueryValidate/jquery.validate.js"></script>

<script type="text/javascript" src="${basePath}assets/jqueryValidate/localization/messages_zh.js"></script>
<script type="text/javascript" src="${basePath}assets/js/coding/edit_medical_ventilator_info.js"></script>
<form action="${basePath }medical_record_coding/edit_medical_ventilator_info" style="height:auto;width: 99.5%" method="post" id="medicalVentilatorInfoForm">
	<input type="hidden" id="visitGuid" name="visitGuid" value="${visitGuid }">
	<table style="width: 100%; border: 0">
		<tbody>
			<tr>
				<td colspan="6" class="dark">
					<div style="float:right">
						<input type="submit" value="保存" class="btn">&nbsp;
					</div></td>
			</tr>
			<tr>
				<td class="tdLabel_7">是否使用呼吸机</td>
				<td class="tdLabel_8">
					<input type="radio"
						class="radio_cl" name="isUsedMedicalVentilatorCode" title="是 " value="1"/>
						是 
					<input type="radio" class="radio_cl" name="isUsedMedicalVentilatorCode" title="否" value="2"/>
						否
				</td>
				
				<td class="tdLabel_7" colspan="2">呼吸机使用总时长（小时）</td>
				<td class="tdLabel_8">
					<input type="text" name="medicalVentilatorUsedHourNumber" class="input_box" 
					value="${medicalVentilatorInfo.medicalVentilatorUsedHourNumber}">
				</td>
				<td class="tdLabel_8" colspan="1"></td>
				
			</tr>
		</tbody>
	</table>
	<input type="hidden" id="medicalVentilatorRecordCount" value="0"/>
	<table style="width: 100%;" id="medicalVentilatorRecords">
		<thead>
			<tr>
				<td colspan="4" class="tdLabel_7">

					<div style="float:right">
						<input type="button" value="新增" onclick="addMedicalVentilatorRecord()"class="btn">
					</div>
				</td>
			</tr>
			<tr>
				<td class="tdLabel_4" style="width: 30%">使用起始日期</td>
				<td class="tdLabel_4" style="width: 30%">使用终止日期</td>
				<td class="tdLabel_4" style="width: 30%">重症监护室类型</td>
				<td class="tdLabel_4" style="width: 10%">操作</td>
			</tr>
			
		</thead>
		<tbody>
		</tbody>
	</table>
</form>
<div hidden="hidden">
	<table>
		<tr id="template_ventilator_tr">
			<td class="tdLabel_8">
				<input type="text" name="medicalVentilatorRecords[0].usedStartDateTime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
			</td>
			<td class="tdLabel_8">
				<input type="text" name="medicalVentilatorRecords[0].usedEndDateTime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
			</td>
			<td class="tdLabel_8">
				<select name="medicalVentilatorRecords[0].icuTypeCode">
				</select>
				<input type="hidden" name="medicalVentilatorRecords[0].icuTypeName"/>
			</td>
			<td class="tdLabel_8">
				<a class="btn" style="padding:4px;margin:0 auto; display: block; position: relative; left:-25%;" onclick="deleteMedicalVentilatorRecord(this)">删除</a>
			</td>
		</tr>
	</table>
</div>

<script>
	$(function(){
		
		var respondResultJson = <%=respondResultJson%>
		if(respondResultJson){
			if(respondResultJson.success){
				layer.msg("保存成功",{offset: '200px'});
			}else{
				layer.msg("保存失败",{offset: '200px'});
			}
		}
		var baseInfoJson= <%=baseInfoJson%>;
		var medicalVentilatorInfoJson= <%=medicalVentilatorInfoJson%>;
		console.log(baseInfoJson);
		console.log(medicalVentilatorInfoJson);
		initPage(baseInfoJson,medicalVentilatorInfoJson);
		
	})
</script>